package com.wondertek.mist.utils;

import android.app.Activity;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;

public class LocalManagerUtils extends Activity implements LocationListener {
    protected LocationManager locationManager;
    protected LocationListener locationListener;
    protected Context context;
  
    String lat;
    String provider;
    protected static String latitude, longitude;
    protected boolean gps_enabled, network_enabled;

      LocalManagerUtils() {
        locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
        locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0,
                0, this);
    }
    
    @Override
    public void onLocationChanged(Location location) {
    	
        latitude=Double.toString(location.getLatitude());
        longitude=Double.toString(location.getLongitude());
    }

    @Override
    public void onProviderDisabled(String provider) {
        Log.d("Latitude", "disable");
    }

    @Override
    public void onProviderEnabled(String provider) {
    	
        Log.d("Latitude", "enable");
    }

    @Override
    public void onStatusChanged(String provider, int status, Bundle extras) {
        Log.d("Latitude", "status");
    }

	public static String getCurrentPosition() {
		String locaStrs =latitude+","+longitude;
		return locaStrs;
	}

}
